< previous page page_731 next page >

Page 731
Temporary Tables
Sometimes youll need to create some temporary tables (also called work tables) for use in your application. Preface all these tables with wrk. Temporary tables should always be created in a separate database if possible. This keeps clutter out of the main database. Additionally, on SQL Server, you can turn logging off on the database that holds the temporary tables. This will help speed up the database access and avoid out-of-log-space errors. In Access, this helps keep the size of the main database from growing and avoids a lot of compacting and possibly repairing.
Column Naming
Just as you name a variable with the data type that variable contains, you should do the same with the column names in your tables. By doing this, you dont need to refer to a printed data dictionary when looking at your source code. Youll be able to see a column name and determine what the data type is immediately. When defining columns to use in your tables, the following form is recommended:
9f31265bb40b592b1929e18a47ab28e5.gif
<prefix><body>_<suffix>
Field Prefix
The prefix specifies the data type of the data stored in a column. The reasoning behind using a prefix to represent the column data type is that it provides useful information during programming. Many of the front-end development tools and data-aware controls in use today for the development of applications display the tables column name only, instead of the column name and data type. When the developer is mapping the columns data type to a Visual Basic, C, or a C++ data type, the column data type must be known in order to map the data correctly. If the programmer/developer constantly has to reference a secondary front-end tool to determine the data type of the column, much time will be wasted and possible errors will result due to incorrect data mapping between the databases data type and the Visual Basic data type.
Table B.1 lists the prefixes to be used in the SQL Server column naming convention. Also displayed in this table is the corresponding Visual Basic data type to be used in the event that a local copy of the SQL Server data is to be used during programming.

 
< previous page page_731 next page >

If you like this book, buy it!